home *** CD-ROM | disk | FTP | other *** search
/ TestDrive Windows 1993 Fall / TestDrive Windows 1993 Fall.iso / dbase / dtl / quickapp.cod < prev    next >
Encoding:
Text File  |  1993-03-09  |  17.4 KB  |  626 lines

  1. //
  2. // Module name: Quickapp.cod
  3. // Description: Quick application template for dBASE IV
  4. //
  5.  
  6. Quick Application Template
  7. --------------------------
  8. Version 2.0.c
  9. Borland International (c) 1987, 1988, 1989, 1990, 1991, 1992, 1993
  10. {
  11.  include "applctn.def"  // Applicaton selectors
  12.  include "builtin.def"  // Builtin Functions
  13.  
  14.  
  15.  if getenv("dtl_debug") then
  16.    debug(2)
  17.    breakpoint( pick_debug )
  18.  endif
  19.  
  20.  var  bnl_formname,     // Name of BNL file to newframe if argument() has value
  21.       arg_list;
  22.  
  23.  arg_list = alltrim(argument())
  24.  
  25.  if arg_list != "" then
  26.    bnl_formname = token( ",", arg_list, 1 )
  27.    if !newframe( bnl_formname ) then
  28.      return -1;
  29.    endif
  30.  endif
  31.  
  32.  // Check menu type
  33.  if MENU_TYPE != app then
  34.    pause(app_class)
  35.    goto NoGen;
  36.  endif
  37.  //
  38.  // Enum string constants for international translation
  39.  //
  40.  enum pack_dbf1 = "Packing database ",
  41.       pack_dbf2 = " to REMOVE records marked for deletion...",
  42.       set_msg1  = "Appending records to file ",
  43.       set_msg2  = "Editing file ",
  44.       set_msg3  = "Browsing file ",
  45.       set_msg4  = "Pick an option to locate a record or <ESC> for default",
  46.       set_msg5  = "Printing report ",
  47.       set_msg6  = "Printing labels",
  48.       quick_bar1= " Add Information", quick_msg1 = "Add records to database ",
  49.       quick_bar2= " Change Information", quick_msg2 = "Edit records in database ",
  50.       quick_bar3= " Browse Information", quick_msg3 = "Browse database ",
  51.       quick_bar4= " Discard Marked Records ", quick_msg4 = "Purge deleted records in database ",
  52.       quick_bar5= " Print Report", quick_msg5 = "Run report form ",
  53.       quick_bar6= " Mailing Labels", quick_msg6 = "Run label form ",
  54.       quick_bar7= " Reindex Database", quick_msg7 = "Reindex database ",
  55.       quick_bar8= " Exit From ", quick_msg8 = "Exit program to dBASE",
  56.       prntchk_bar1= " Send to...",
  57.       prntchk_bar3= " Screen ", prntchk_msg3= "Screen only" ,
  58.       prntchk_bar4= " Printer ", prntchk_msg4= "Printer LPT1:",
  59.       prntchk_bar5= " Label Sample ", prntchk_msg5= "Printer LPT1: with Sample label",
  60.       prntchk_bar6= " Return", prntchk_msg6= "Return to Main Menu",
  61.       reindex_dbf = "Reindexing database ",
  62.       ready_printer = "Please ready your printer or",
  63.       press_esc = "     press ESC to cancel",
  64.       error_occured = "[Error occurred on line ]+LTRIM(STR(LINE())) +[ of procedure ]+Program()",
  65.  ;
  66.  //
  67.  // End string constants for international translation
  68.  //
  69.  // Declare variables
  70.  var quickapp, barcnt, rptchoice, lblchoice, ndxchoice, file, crlf, x, color,
  71.      ask_user, strng, author, copyright, dbVersion, default_drv, temp,
  72.      scrn_size, display // Type of display
  73.  ;
  74.  
  75.  // Grab default drive from dBASE
  76.  // See bottom of Builtin.def for numset & strset enum's
  77.  default_drv = strset(_defdrive);
  78.  
  79.  if filedrive(menu_name) or !default_drv then
  80.    quickapp = alltrim(menu_name);
  81.  else
  82.    quickapp = default_drv + ":" + alltrim(menu_name);
  83.  endif
  84. // quickapp = upper(quickapp);
  85.  
  86.  // Assign default values to some of the variables
  87.  barcnt = 4;
  88.  crlf = chr(10);
  89.  author = Appl_Authr;
  90.  copyright = Appl_cpyrt;
  91.  dbVersion = Appl_Versn;
  92.  screen_size();
  93.  scrn_size = scrn_size + 3;
  94.  
  95.  // Check to see if file exists and safety is on
  96.  if fileexist(quickapp+".prg") and numset(_safety) then
  97.    do while not at(upper(ask_user),"YN")
  98.       ask_user = askuser("Application "+quickapp+".prg already exists...Overwrite (Y/N)","N",1);
  99.    enddo
  100.    if upper(ask_user) == "N" then
  101.      pause(gen_request + any_key)
  102.      goto NoGen;
  103.    endif
  104.  endif
  105. //
  106. //----------------------------------
  107. //Create Quickapp main program
  108. //----------------------------------
  109. //
  110.  if not create(quickapp+".prg") then
  111.     pause(fileroot(quickapp)+".prg" + read_only + any_key)
  112.     goto nogen;
  113.  endif
  114.  
  115.  print(replicate("*",80)+crlf);
  116. }
  117. * Program......: {quickapp}
  118. {include "as_headr.cod";}
  119. * Notes........:
  120. {print(replicate("*",80)+crlf);}
  121.  
  122. SET CONSOLE OFF
  123. IF TYPE("gn_apgen") = "U"  && We were not called from another APGEN program
  124.    CLEAR ALL
  125.    CLEAR WINDOW
  126.    CLOSE DATABASE
  127.    gn_apgen = 1
  128. ELSE
  129.    gn_apgen = gn_apgen + 1
  130.    PRIVATE gc_bell, gc_carry, gc_clock, gc_century, gc_confirm, gc_deli,;
  131.            gc_escape, gc_safety, gc_status, gc_score, gc_talk, gc_color,;
  132.            gc_proc
  133. ENDIF
  134.  
  135. *-- Window for pause message box (ON ERROR)
  136. DEFINE WINDOW Pause FROM 15,00 TO 19,79 DOUBLE
  137. ON ERROR DO PAUSE WITH {error_occured}
  138. ON KEY LABEL F1 DO quickhlp
  139.  
  140. *-- Store initial SETs to variables
  141. gc_bell   =SET("BELL")
  142. gc_carry  =SET("CARRY")
  143. gc_clock  =SET("CLOCK")
  144. gc_century=SET("CENTURY")
  145. gc_confirm=SET("CONFIRM")
  146. gc_cursor =SET("CURSOR")
  147. gc_deli   =SET("DELIMITERS")
  148. gc_escape =SET("ESCAPE")
  149. gc_proc   =SET("PROCEDURE")
  150. gc_safety =SET("SAFETY")
  151. gc_status =SET("STATUS")
  152. gc_score  =SET("SCOREBOARD")
  153. gc_talk   =SET("TALK")
  154.  
  155. SET CLOCK OFF
  156. CLEAR
  157. SET CONSOLE ON
  158.  
  159. *-- Sets for application
  160. SET BELL {if Set_Bell then}OFF{else}ON{endif}
  161. {if Set_BellFr and Set_BellDr then}
  162. SET BELL TO {Set_BellFr},{Set_BellDr}
  163. {endif}
  164. SET CARRY {if Set_Carry then}ON{else}OFF{endif}
  165. SET CENTURY {if Set_Centry then}ON{else}OFF{endif}
  166. SET CONFIRM {if Set_Confrm then}ON{else}OFF{endif}
  167. SET CURSOR OFF
  168. SET DELIMITERS TO \
  169. {if not AT(CHR(34),Set_DelChr) then}"{Set_DelChr}"
  170. {  goto deliok;
  171.  endif
  172.  if not AT("'",Set_DelChr) then}'{Set_DelChr}'
  173. {  goto deliok;
  174.  endif
  175.  if not AT("[",Set_DelChr) or not AT("]",Set_DelChr) then}[{Set_DelChr}]
  176. {  goto deliok;
  177.  endif
  178. }
  179. ""
  180. {deliok:}
  181. SET DELIMITER {if Set_Delim then}ON{else}OFF{endif}
  182. SET ESCAPE {if Set_Escape then}OFF{else}ON{endif}
  183. SET SAFETY {if Set_Safety then}OFF{else}ON{endif}
  184. SET SCOREBOARD OFF
  185. SET STATUS OFF
  186. SET TALK OFF
  187. //
  188. {if Run_Drive then}
  189. SET DEFAULT TO {UPPER(Run_Drive)}:
  190. {endif}
  191. {if Run_Path then}
  192. SET PATH TO {Run_Path}
  193. {endif}
  194.  
  195. *-- Set global variables
  196. gn_barv  = 0{tabto(30)}&& Initialize bar value variable
  197. gn_error = 0{tabto(30)}&& Variable to store error() number
  198. gn_send  = 0{tabto(30)}&& Return variable from popup
  199. gc_brdr  = "2"{tabto(30)}&& Border style for menu box - See Procedure
  200. lc_heading = "{if quick_hdng then
  201.   alltrim(Quick_Hdng)
  202. else
  203.   fileroot(Upper(quickapp))
  204. endif}" && Menu heading string
  205.  
  206. gl_color = ISCOLOR()
  207. gc_scope = ""
  208. {if Disp_Sign then}
  209. // Display Signon Banner
  210. SET ESCAPE OFF
  211.  
  212. *-- Signon Banner
  213. @ {row1()},{col1()} TO {row2()},{col2()} \
  214. {   case Mnu_Border of}
  215. {   0: // Panel}
  216. PANEL \
  217. {   1: // Single}
  218.  \
  219. {   2: // Double}
  220. DOUBLE \
  221. {   endcase}
  222.  
  223. {   foreach text_element}
  224. @ {row1()+Row_Positn},{col1()+Col_Positn} SAY "{Text_Item}"
  225. {   next}
  226. IF gl_color
  227.    @ {row1()+1},{col1()+1} FILL TO {row2()-1},{col2()-1}
  228. ENDIF
  229. @ IIF("43" $ SET("DISPLAY"),42,24),30 \
  230. SAY "Press any key ..."
  231. SET CONSOLE OFF                       && For mouse click recognition
  232. WAIT
  233. SET CONSOLE ON
  234. CLEAR
  235.  
  236. {endif}
  237. SET ESCAPE {if Set_Escape then}OFF{else}ON{endif}
  238. SET STATUS ON
  239.  
  240. //
  241.  
  242. {dBFOpen(Quick_DBF, Quick_NDX, Quick_Ordr);}
  243.  
  244. *-- Define the main popup menu for Quickapp
  245. SET BORDER TO DOUBLE
  246. DEFINE POPUP quick FROM 7,27
  247. DEFINE BAR 1 OF quick PROMPT "{quick_bar1}" MESSAGE "{quick_msg1 + Quick_DBF}"
  248. DEFINE BAR 2 OF quick PROMPT "{quick_bar2}" MESSAGE "{quick_msg2 + Quick_DBF}"
  249. DEFINE BAR 3 OF quick PROMPT "{quick_bar3}" MESSAGE "{quick_msg3 + Quick_DBF}"
  250. DEFINE BAR 4 OF quick PROMPT "{quick_bar4}" MESSAGE "{quick_msg4 + Quick_DBF}"
  251. { if Quick_FRM then barcnt=barcnt+1; rptchoice=barcnt;}
  252. DEFINE BAR {barcnt} OF quick PROMPT "{quick_bar5}" MESSAGE "{quick_msg5 + Quick_FRM}"
  253. { endif
  254.   if Quick_LBL then barcnt=barcnt+1; lblchoice=barcnt;}
  255. DEFINE BAR {barcnt} OF quick PROMPT "{quick_bar6}" MESSAGE "{quick_msg6 + Quick_LBL}"
  256. { endif
  257.   if Quick_NDX or Quick_Ordr then barcnt=barcnt+1; ndxchoice=barcnt;}
  258. DEFINE BAR {barcnt} OF quick PROMPT "{quick_bar7}" MESSAGE "{quick_msg7 + Quick_DBF}"
  259. { endif
  260.   barcnt=barcnt+1;
  261.  strng=fileroot(quickapp);
  262.  strng=upper(substr(strng,1,1))+lower(substr(strng,2,7));}
  263. DEFINE BAR {barcnt} OF quick PROMPT "{quick_bar8 + strng}" MESSAGE "{quick_msg8}"
  264. ON SELECTION POPUP quick DO Action WITH BAR()
  265.  
  266. {if Quick_LBL or Quick_FRM then}
  267. *-- Define the popup menu for print redirection
  268. DEFINE POPUP prntchk FROM 10,55
  269. DEFINE BAR 1 OF prntchk PROMPT "{prntchk_bar1}" SKIP
  270. DEFINE BAR 2 OF prntchk PROMPT REPLICATE(CHR(196),14) SKIP
  271. DEFINE BAR 3 OF prntchk PROMPT "{prntchk_bar3}" MESSAGE "{prntchk_msg3}"
  272. DEFINE BAR 4 OF prntchk PROMPT "{prntchk_bar4}" MESSAGE "{prntchk_msg4}"
  273. DEFINE BAR 5 OF prntchk PROMPT "{prntchk_bar5}" MESSAGE "{prntchk_msg5}" \
  274.  SKIP{if Quick_LBL} FOR gn_barv <> {lblchoice}{endif}
  275. DEFINE BAR 6 OF prntchk PROMPT "{prntchk_bar6}" MESSAGE "{prntchk_msg6}"
  276. ON SELECTION POPUP prntchk DEACTIVATE POPUP
  277. {endif}
  278.  
  279. *-- Window to cover work surface during edit, append, etc.
  280. DEFINE WINDOW work FROM 0,0 TO 21,79 NONE
  281.  
  282. *-- Window for area below menu heading & for running reports/labels in
  283. DEFINE WINDOW desktop FROM 4,0 TO 21,79 NONE
  284.  
  285. DEFINE WINDOW printemp FROM 10,25 TO 15,56
  286.  
  287. *-- Display heading centered on the screen.
  288. DO menubox WITH lc_heading
  289.  
  290. *-- Show the menu so we don't get a flash if the user hits arrow keys or ESC
  291. SHOW POPUP quick
  292. SAVE SCREEN TO quick
  293. *-- Display Quickapp menu centered on the screen.
  294. DO WHILE gn_barv <> {barcnt} && Prevent user from exiting with arrow keys or ESC
  295.   ACTIVATE POPUP quick
  296. ENDDO
  297.  
  298. * Restore SET environment the best we can
  299. SET BELL &gc_bell.
  300. SET CARRY &gc_carry.
  301. SET CLOCK TO
  302. SET CLOCK &gc_clock.
  303. SET CENTURY &gc_century.
  304. SET CONFIRM &gc_confirm.
  305. SET CURSOR &gc_cursor.
  306. SET DELIMITERS &gc_deli.
  307. SET ESCAPE &gc_escape.
  308. SET FORMAT TO
  309. SET PROCEDURE TO (gc_proc)
  310. SET STATUS &gc_status.
  311. SET SAFETY &gc_safety.
  312. SET SCORE  &gc_score.
  313. SET TALK   &gc_talk.
  314.  
  315. IF gn_apgen = 1 && We were not called from another APGEN program
  316.    CLEAR WINDOW
  317.    CLEAR POPUP
  318.    CLEAR ALL
  319.    CLOSE DATABASE
  320. ELSE
  321.    RELEASE WINDOWS work, desktop
  322.    RELEASE SCREEN quick
  323.    RELEASE POPUP quick
  324.    gn_apgen = gn_apgen - 1
  325. ENDIF
  326. ON ERROR
  327. ON KEY LABEL F1
  328. RETURN
  329. * EOP: {Quickapp}.prg
  330.  
  331. //
  332. //-------------------------------------------------------------------------
  333. //  Create Quickapp procedure file
  334. //  Since the dBASE compiler does not care that their are procedures in the
  335. //  same file as the program we tack the procedures onto the bottom.
  336. //-------------------------------------------------------------------------
  337. //
  338. {print(replicate("*",80)+crlf);}
  339. * Procedures...: {quickapp}.Prc
  340. {include "as_headr.cod";}
  341. * Notes........:
  342. {print(replicate("*",80)+crlf);}
  343.  
  344. *-- Here is a sample procedure file to show the power of procdures.
  345. *-- This example - Menubox displays a menu heading box with a centered heading.
  346. PROCEDURE MenuBox
  347. PARAMETER lc_m_name
  348. *-- Parameter lc_m_name - is the title variable for the menu
  349.   PRIVATE cInfo, cBox
  350.   cInfo = ColorChk( "I" )
  351.   cBox = ColorChk( "B" )
  352.  
  353.   SET CLOCK OFF
  354.   @ 1,0 FILL TO 2,79 COLOR &cInfo
  355.   DO CASE
  356.     CASE gc_brdr = "0"
  357.       @ 1,0 CLEAR TO 3,79
  358.     CASE gc_brdr = "1"
  359.       @ 1,0 TO 3,79
  360.     CASE gc_brdr = "2"
  361.       @ 1,0 TO 3,79 DOUBLE COLOR &cBox
  362.   ENDCASE
  363.   SET CLOCK TO 2,68
  364.   @ 2,1 SAY SUBSTR(CDOW(DATE()),1,3)+'. '+DTOC(DATE())+' '  COLOR &cInfo
  365. // Because of the length of the heading in the generator I am using 41 so that
  366. // the date display does not touch the heading.
  367.   @ 2,41 - (LEN(lc_m_name)/2) SAY lc_m_name  COLOR &cInfo
  368. RETURN
  369. *-- EOP: MenuBox
  370.  
  371.  
  372. FUNCTION ColorChk
  373. PARAMETERS pc_WhichCo
  374. *---------------------------------------------------------------------
  375. * DESCRIPTION
  376. *   _ColorChk() returns a string representing one of eight
  377. *   possible color attribute values.  
  378. *---------------------------------------------------------------------
  379.  
  380.   PRIVATE lc_colattr, lc_whichco, ln_count, ln_stop_at, lc_attrib
  381.  
  382.   lc_whichco = UPPER(LEFT(pc_whichco,1))
  383.   lc_attrib  = SET("ATTRIBUTE")
  384.  
  385.   IF lc_whichco $ "MTBIF"
  386.     lc_colattr = SUBSTR(lc_attrib, AT("&", lc_attrib) + 2)
  387.   ELSE
  388.     lc_colattr = LEFT(lc_attrib, AT("&", lc_attrib) - 2)
  389.   ENDIF
  390.  
  391.   DO CASE
  392.     CASE lc_whichco = "F"
  393.       ln_stop_at = 4
  394.     CASE lc_whichco = "I"
  395.       ln_stop_at = 3
  396.     CASE lc_whichco $ "BP"
  397.       ln_stop_at = 2
  398.     CASE lc_whichco $ "TH"
  399.       ln_stop_at = 1
  400.     OTHERWISE
  401.       ln_stop_at = 0
  402.   ENDCASE
  403.  
  404.   ln_count = 1
  405.  
  406.   DO WHILE m->ln_count <= m->ln_stop_at
  407.     lc_colattr = SUBSTR(m->lc_colattr, AT(",", m->lc_colattr) + 1)
  408.     ln_count = m->ln_count + 1
  409.   ENDDO
  410.  
  411. RETURN IIF("," $ lc_colattr, ;
  412.             LEFT(lc_colattr, AT(",", lc_colattr) - 1), ;
  413.             lc_colattr ;
  414.           )
  415. *-- EOF: ColorChk( pc_WhichCo )
  416.  
  417.  
  418. PROCEDURE get_sele
  419. *-- Get the user selection & store BAR into variable
  420. gn_send = BAR()  && Variable for print testing
  421. DEACTIVATE POPUP
  422. RETURN
  423.  
  424. PROCEDURE Action
  425. PARAMETERS bar
  426. *-- Get the user selection & store BAR into variable
  427. gn_barv = bar
  428. lc_toprnt=''
  429. SET MESSAGE TO
  430. IF LTRIM( STR( gn_barv)) $ "123"
  431.    SET CURSOR ON
  432. {if Quick_FMT then}
  433.    *-- Set format file {Quick_FMT} for edit/append/browse
  434.    SET FORMAT TO {Quick_FMT}
  435. {endif}
  436. ENDIF
  437. DO CASE
  438.    CASE gn_barv = 1
  439.       *-- Add information
  440.       SET MESSAGE TO '{set_msg1 + Quick_DBF}'
  441.       APPEND
  442.    CASE gn_barv = 2
  443.       *-- Change information
  444.       SET MESSAGE TO '{set_msg2 + Quick_DBF}'
  445.       EDIT
  446.    CASE gn_barv = 3
  447.       *-- Browse information
  448.       SET MESSAGE TO '{set_msg3 + Quick_DBF}'
  449.       BROWSE {if Quick_FMT then}FORMAT {endif}
  450.    CASE gn_barv = 4
  451.       *-- Remove information (Pack file {lower(Quick_DBF)})
  452.       ACTIVATE WINDOW desktop
  453.       @ 2,0 SAY "{pack_dbf1 + Quick_DBF + pack_dbf2}"
  454.       @ 3,0
  455.       SET TALK ON
  456.       PACK
  457.       GO TOP
  458.       ?
  459.       WAIT
  460.       SET TALK OFF
  461.       DEACTIVATE WINDOW desktop
  462. {  if Quick_FRM}
  463.    CASE gn_barv = {rptchoice}
  464.       *-- Run report form {lower(Quick_FRM)}
  465.       SET MESSAGE TO '{set_msg4}'
  466.       ACTIVATE WINDOW work
  467.       gn_recno = RECNO()
  468.       DO position
  469.       DEACTIVATE WINDOW work
  470.       STORE 0 TO gn_send, gn_pkey
  471.       ACTIVATE POPUP prntchk
  472.       gn_send = BAR()
  473.       IF gn_send = 4
  474.          lc_toprnt = 'TO PRINT'
  475.          ON ERROR DO prntrtry
  476.       ENDIF
  477.       IF gn_send <> 6 .AND. gn_send <> 0
  478.          SET MESSAGE TO '{set_msg5 + Quick_FRM}'
  479.          ACTIVATE WINDOW desktop
  480.          SET ESCAPE ON
  481.          REPORT FORM {Quick_FRM} &gc_scope. &lc_toprnt.
  482.          IF gn_pkey <> 27
  483.             WAIT
  484.          ENDIF
  485.          SET ESCAPE {if Set_Escape then}OFF{else}ON{endif}
  486.          DEACTIVATE WINDOW desktop
  487.       ENDIF
  488.       GOTO gn_recno
  489.       ON ERROR DO PAUSE WITH {error_occured}
  490. {  endif
  491.    if Quick_LBL}
  492.    CASE gn_barv = {lblchoice}
  493.       *-- Run label form {lower(Quick_LBL)}
  494.       SET MESSAGE TO '{set_msg4}'
  495.       ACTIVATE WINDOW work
  496.       gn_recno = RECNO()
  497.       DO position
  498.       DEACTIVATE WINDOW work
  499.       STORE 0 TO gn_send, gn_pkey
  500.       ACTIVATE POPUP prntchk
  501.       gn_send = BAR()
  502.       DO CASE
  503.        CASE gn_send = 4
  504.          lc_toprnt = 'TO PRINT'
  505.        CASE gn_send = 5
  506.          lc_toprnt = 'TO PRINT SAMPLE'
  507.       ENDCASE
  508.       IF gn_send <> 6 .AND. gn_send <> 0
  509.          SET MESSAGE TO '{set_msg6}'
  510.          ACTIVATE WINDOW desktop
  511.          SET ESCAPE ON
  512.          ON ERROR DO prntrtry
  513.          LABEL FORM {Quick_LBL} &gc_scope. &lc_toprnt.
  514.          IF gn_pkey <> 27
  515.             WAIT
  516.          ENDIF
  517.          SET ESCAPE {if Set_Escape then}OFF{else}ON{endif}
  518.          DEACTIVATE WINDOW desktop
  519.       ENDIF
  520.       GOTO gn_recno
  521.       ON ERROR DO PAUSE WITH {error_occured}
  522. {  endif
  523.    if Quick_NDX or Quick_Ordr}
  524.    CASE gn_barv = {ndxchoice}
  525.       *-- Reindex {lower(Quick_DBF)}
  526.       ACTIVATE WINDOW desktop
  527.       @ 3,0 SAY "{reindex_dbf + Quick_DBF + "..."}"
  528.       @ 4,0
  529.       SET TALK ON
  530.       REINDEX
  531.       GO TOP
  532.       ?
  533.       WAIT
  534.       SET TALK OFF
  535.       DEACTIVATE WINDOW desktop
  536. {  endif}
  537.    CASE gn_barv = {barcnt}
  538.       DEACTIVATE POPUP
  539. ENDCASE
  540. SET MESSAGE TO
  541. SET CURSOR OFF
  542. {if Quick_FMT then}
  543. IF gc_status = "OFF"
  544.    SET STATUS ON
  545. ENDIF
  546. SET FORMAT TO
  547. {endif}
  548. RESTORE SCREEN FROM quick
  549. RETURN
  550.  
  551. {include "as_pause.cod"}
  552.  
  553. PROCEDURE quickhlp
  554. *--  If you want to include help for a quickapp uncomment the lines below and
  555. *--  put your help @ say's into the case statements
  556. *ACTIVATE WINDOW desktop
  557. *CLEAR
  558. DO CASE
  559. {for temp = 1 to barcnt}
  560.   CASE BAR() = {temp}
  561. {next}
  562. ENDCASE
  563. *WAIT
  564. *DEACTIVATE WINDOW desktop
  565. RETURN
  566.  
  567. {if Quick_LBL or Quick_FRM then
  568.   include "as_posit.cod";}
  569.  
  570. PROCEDURE prntrtry
  571. PRIVATE lc_escape
  572. lc_escape = SET("ESCAPE")
  573. IF .NOT. PRINTSTATUS()
  574.    IF lc_escape = "ON"
  575.       SET ESCAPE OFF
  576.    ENDIF
  577.    gn_pkey = 0
  578.    ACTIVATE WINDOW printemp
  579.    @ 1,0 SAY "{ready_printer}"
  580.    @ 2,0 SAY "{press_esc}"
  581.    DO WHILE ( .NOT. PRINTSTATUS()) .AND. gn_pkey <> 27
  582.       gn_pkey = INKEY()
  583.    ENDDO
  584.    DEACTIVATE WINDOW printemp
  585.    SET ESCAPE &lc_escape.
  586.    IF gn_pkey <> 27
  587.       RETRY
  588.    ENDIF
  589. ENDIF
  590. RETURN
  591. { endif}
  592.  
  593. *-- EOF: {quickapp}.prg
  594. {pause(gen_complete + any_key);
  595.  fileerase(quickapp+".dbo");
  596.  NoGen:
  597.  return 0;
  598. //
  599. //-------------------------------
  600. // End of quickapp
  601. // User defined functions include
  602. //-------------------------------
  603. //
  604.  define dbfOpen(mdbf,mndx,mord)
  605.    if at(upper(filetype(mdbf)), ".QBE,.QBO,.VUE") then}
  606. SET VIEW TO {mdbf}
  607. {    if mndx then}
  608. SET INDEX TO {mndx}
  609. {    endif
  610.      if mord then}
  611. SET ORDER TO {mord}
  612. {    endif
  613.    else}
  614. USE {mdbf} {if mndx then}INDEX {mndx}{endif}
  615. {    if mord then}
  616. SET ORDER TO {mord}
  617. {    endif
  618.    endif
  619.   return;
  620.  enddef
  621.  
  622.  
  623. include "cm_udf.cod"  // Template language UDFs
  624. }
  625. // EOP QUICKAPP.COD
  626.